/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.bus.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 验证码信息Entity
 * @author ZYJ
 * @version 2019-05-31
 */
public class VerificationCode extends DataEntity<VerificationCode> {
	
	private static final long serialVersionUID = 1L;
	private String mobile;		// 手机号
	private String code;		// 验证码
	private Date deadline;		// 过期时间
	private int usedStatus;		// 是否已用
	private String ip;		// IP地址
	
	public VerificationCode() {
		super();
	}

	public VerificationCode(String id){
		super(id);
	}
	public VerificationCode(String code ,String mobile,String ip,Date deadline ){
		super();
		this.code = code;
		this.mobile = mobile;
		this.ip = ip;
		this.deadline = deadline;
	}

	@Length(min=0, max=11, message="手机号长度必须介于 0 和 11 之间")
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	@Length(min=0, max=4, message="验证码长度必须介于 0 和 4 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getDeadline() {
		return deadline;
	}

	public void setDeadline(Date deadline) {
		this.deadline = deadline;
	}

	public int getUsedStatus() {
		return usedStatus;
	}

	public void setUsedStatus(int usedStatus) {
		this.usedStatus = usedStatus;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}
	
}